package binaryTree;

import java.util.ArrayList;
import java.util.List;

public class Test {

    public static void main(String[] args) {
        BinaryTree binaryTree = new BinaryTree();

        BinaryTree.TreeNode root = binaryTree.createTree();

        List<BinaryTree.TreeNode> ret = binaryTree.preOrder2(root);
        for(BinaryTree.TreeNode x : ret) {
            System.out.print(x.val + " ");
        }

        System.out.println();

        List<BinaryTree.TreeNode> ret2 = binaryTree.inorderTraversal(root);
        for(BinaryTree.TreeNode x : ret2) {
            System.out.print(x.val + " ");
        }

        System.out.println();

        List<BinaryTree.TreeNode> ret3 = binaryTree.postorderTraversal(root);
        for(BinaryTree.TreeNode x : ret3) {
            System.out.print(x.val + " ");
        }

    }
}
